﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using QdpzWtm.Models;
using QdpzWtm.Models.BaseSeting;


namespace QdpzWtm.ViewModels.ArticleManagementVMs
{
    public partial class ArticleManagementTemplateVM : BaseTemplateVM
    {
        [Display(Name = "标题")]
        public ExcelPropety Title_Excel = ExcelPropety.CreateProperty<ArticleManagement>(x => x.Title);
        [Display(Name = "文章类型")]
        public ExcelPropety ArticleManagementType_Excel = ExcelPropety.CreateProperty<ArticleManagement>(x => x.ArticleManagementTypeId);
        [Display(Name = "文章内容")]
        public ExcelPropety MainContent_Excel = ExcelPropety.CreateProperty<ArticleManagement>(x => x.MainContent);
        [Display(Name = "文章坐车")]
        public ExcelPropety Author_Excel = ExcelPropety.CreateProperty<ArticleManagement>(x => x.Author);
        [Display(Name = "发布时间")]
        public ExcelPropety UpTime_Excel = ExcelPropety.CreateProperty<ArticleManagement>(x => x.UpTime);

	    protected override void InitVM()
        {
            ArticleManagementType_Excel.DataType = ColumnDataType.ComboBox;
            ArticleManagementType_Excel.ListItems = DC.Set<ArticleManagementType>().GetSelectListItems(Wtm, y => y.ArticleManagementTypeName);
        }

    }

    public class ArticleManagementImportVM : BaseImportVM<ArticleManagementTemplateVM, ArticleManagement>
    {

    }

}
